# @Author: Eric Ito
# @Date: 1/29/2009
# @Name: Project Euler Problem 29

"""
How many distinct terms are created by the sequence

a^b for 2 <= a <= 100, 2 <= b <= 100
"""

"""
Since we just care about distinct terms

we can use a dictionary to store the terms as keys.
so iterate through the possible a,b values, storing
a**b as the key in each case.

we don't care if we overwrite a previous one since
we just want uniq values
"""


def main():
    terms = {}
    for a in range(2,101):
        for b in range(2,101):
            terms[a**b] = ""
    print len(terms)


if __name__ == "__main__":
    main()